#!/usr/bin/python3
# -*- coding: utf-8 -*-
# ======================================#
# @Author   : duanqizhong
# @time     : 2020/6/7 23:42
# @file     : utils.py
# @Software : PyCharm
# ======================================#

import time


def get_current_datetime():
    format = "%Y-%m-%d %H:%M:%S"
    return time.strftime(format, time.localtime())


def parse_parameter_value_to_dict(records):
    dicts = {}
    for record in records:
        dicts[record.get("parameter")] = record.get("value")
    return dicts
